<template>
	<div v-show="showPage">
		<div style="border-bottom: 1px solid #ddd;">
			<h3>表单选择</h3>
		</div>
		<div style="margin-top: 10px;">
			<div>表单</div>
			<el-select size="mini" v-model="formCode" placeholder="请选择"  clearable filterable>
				<el-option v-for="item in formCodeList" :key="item.value" :label="item.name" :value="item.value">
				</el-option>
			</el-select>
		</div>
		<div style="margin-top: 10px;">
			<div>手机端表单</div>
			<el-select size="mini" v-model="mobileFormCode" placeholder="请选择"  clearable filterable>
				<el-option v-for="item in mobileFormCodeList" :key="item.value" :label="item.name" :value="item.value">
				</el-option>
			</el-select>
		</div>
	</div>
</template>

<script>
	import restUtil from '@/utils/restUtil.js';
	export default {
		name: "FormPageSelectPage",
		props: ["scope"],
		data() {
			return {
				showPage: false,
				formCodeList: [],
				formCode:"",
				mobileFormCodeList: [],
				mobileFormCode:""
			}
		},
		mounted() {
		
		},
		methods: {
			init() {
				var that = this;
				restUtil.getAction(this,"webide/workflowwizarddialog/initFormPageSelectPage").then(
					function(response) {
						if (response.data.code == 1) {
							that.formCodeList = response.data.formCodeList;
							that.mobileFormCodeList = response.data.mobileFormCodeList;
						} else {
							that.$alert(response.data.message, '提示')
						}
					});
			},
			setVisible(visible) {
				this.showPage = visible;
				if(visible){
					if(this.formCodeList.length==0){
						this.init();
					}
				}
			},getReturnData(){
				var data={"formCode":this.formCode,"mobileFormCode":this.mobileFormCode};
				return data;
			},getPreviousPage(){
				return "workflowBaseInfoPage";
			},getNextPage(){
				return "approvalLevelPage";
			},isCompletedPage(){
				return false;
			}
		},
	}
</script>

<style>
</style>
